var basepath = "http://localhost:8081/base/"
$(function () {
    $.ajax({
        type: 'POST',
        url: basepath + 'upload/getList',//批次编辑页面
        success: function (data) {
            addHtml(data);
        }
    })
})

function addHtml(data){

    $("#file_list_boty").html("");

    if (undefined == data.list || undefined == data.list.length || 0 == data.list.length){
        $("#file_list_boty").append("<tr><td style='text-align:center' colspan='4'>未查询到相关数据</td></tr>")
    }else {
        for (var i = 0;i < data.list.length; i++){
            $("#file_list_boty").append("<tr>"
                +"<td><div class='autocut' title='"+ data.list[i].id+ "'>"+ data.list[i].id+ "</td>"
                +"<td><div class='autocut' title='"+ data.list[i].url+ "'><a target='_blank' href='"+basepath + data.list[i].url+ "'>"+data.list[i].url+"</a></td>"
                +"<td><div class='autocut' title='"+ data.list[i].size+ "'>"+ data.list[i].size+ "</td>"
                +"<td><div class='autocut' title='"+ data.list[i].description+ "'>"+ data.list[i].description+ "</td>"
            )
        }
    }
}

function toUpload() {
    window.location.href = basepath + "main/toDemo";
}